package com.aiobc.business.common.controller;

import com.aiobc.business.common.domain.SysDict;
import com.aiobc.business.common.service.BasicService;
import com.aiobc.common.core.constant.DictConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/dict")
@Api(tags = "数据字典")
public class DictController {
    @Autowired
    private BasicService basicService;

    @ApiOperation(value = "查询所有应用类型")
    @GetMapping("/queryAllApplicationType")
    public List<SysDict> queryAllApplicationType(){
        return basicService.getListByTypeCode(DictConstants.APPLICATION_TYPE);
    }
    @ApiOperation(value = "查询所有所属领域")
    @GetMapping("/queryAllTerritoryScope")
    public List<SysDict> queryAllTerritoryScope(){
        return basicService.getListByTypeCode(DictConstants.TERRITORY_SCOPE);
    }
    @ApiOperation(value = "查询开发者类型")
    @GetMapping("/queryAllDeveloperType")
    public List<SysDict> queryAllDeveloperType(){
        return basicService.getListByTypeCode(DictConstants.DEVELOPER_TYPE);
    }
}
